<?PHP

class product_category
{
	var $name;
	var $id;
	var $parent;
	var $display;
	var $categories;
	var $data;
	
	function check_for_subcategories()
	{
		
	}
	
	function get_subcategories()
	{
		
			$table='product_category';
			$key='id';

			if(!empty($this->id))
			{
					$w[0]='parent';
					$w[1]=$this->parent;
					$w[2]='=';	
					$where[]=$w;
			}
			$data=get_sql($table,$key,$where,$o);


			return $data;
	}
	
	
	function get_category()
	{
		$table='product_category';
		$key='id';
		
		if(!empty($this->id))
		{
				$w[0]='id';
				$w[1]=$this->id;
				$w[2]='=';	
				$where[]=$w;
				

		}
	
		
		$data=get_sql($table,$key,$where,$o);
	
		$this->data=$data;
		return $data;
	}
	
}

?>